import React, { Component } from "react";
import SearchApp from './components/SearchApp'
import SearchAppList from './components/SearchList'
export default class App extends Component {
  state={
    users:[],//初始化状态，users初始值为数组
    isFirst:true,//是否第一次打开页面
    isLoading:false,//标识是否处于加载中
    err:''//存储请求相关的错误信息
  }

  // 更新app的state
  updateAppState=(stateObj)=>{
    this.setState(stateObj)
  }
  render() {

    return (
      <div>
        <div className="container">
          <SearchApp updateAppState={this.updateAppState}></SearchApp>
          <SearchAppList {...this.state}></SearchAppList>
        </div>
      </div>
    );
  }
}
